package com.bootdo.acitvity.controller;

import com.bootdo.acitvity.po.DeptDO;
import com.bootdo.acitvity.po.OaStudentDO;
import com.bootdo.acitvity.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/demo")
@RestController
public class DemoController {

    @Autowired
    private DeptService sysDeptService;

    @RequestMapping("/list")
    Object list(@RequestParam Map<String, Object> params) {
        DeptDO deptDO = sysDeptService.get(6L);
        String name = deptDO.getName();
        return name;
    }
    @RequestMapping("/test02")
    Object test02(@RequestParam Map<String, Object> params) {
        DeptDO deptDO = sysDeptService.test02(6L);
        String name = deptDO.getName();
        return name;
    }
    @RequestMapping("/getStuentById")
    Object getStuentById() {
        OaStudentDO stuent = sysDeptService.getStuent(3L);
        String name = stuent.getName();
        return name;
    }

    @GetMapping(value = "/helloSentinel")
    public String helloSentinel(@RequestParam Map<String, Object> params) {
        return sysDeptService.helloSentinel(params);
    }
}
